﻿Ext.define('I2R.view.configusers', {
    extend: 'Ext.Panel',
    alias: 'widget.i2rconfigusers',
    border: false,
    bodyCls: 'padd-up',
    layout: 'fit',
    initComponent: function () {
        var me = this;

        var userstore = Ext.data.StoreManager.lookup('users');

        me.items = [
            {
                id: 'usersgrid',
                xtype: 'grid',
                store: userstore,
                columns: [
                    { header: '#', dataIndex: 'Id', width: 50 },
                    { header: 'Username', dataIndex: 'Username', width: 150 },
                    { header: 'Firstname', dataIndex: 'Firstname', width: 200 },
                    { header: 'Lastname', dataIndex: 'Lastname', flex: 1 }
                ],
                dockedItems: [{
                    id: 'usersgrid-pager',
                    xtype: 'pagingtoolbar',
                    store: userstore,   // same store GridPanel is using
                    dock: 'bottom',
                    displayInfo: true
                }],
                tbar: [
                    { xtype: 'button', text: 'Add user', action: 'adduser', iconCls: 'icon_user-add' }
                ]
            }
        ];


        me.callParent(arguments);
    }
});